{% load manager_category_tags %}

<div class="ui-table-wrap">
    <table class="ui-table ui-table-border ui-table-hover ui-table-striped ui-mt ui-mb">
        <thead class="ui-thead-gray">
            <tr>
                <th width="80">排序</th>
                <th width="80">栏目ID</th>
                <th>栏目名称</th>
                <th width="120">模型</th>
                <th width="90">导航显示</th>
                <th width="90">新窗口</th>
                <th width="90">列表筛选</th>
                <th width="360">操作</th>
            </tr>
        </thead>
        <tbody>
            {% if not page_obj %}
            <tr>
                <td colspan="8">暂无数据</td>
            </tr>
            {% endif %}
            {% for item in page_obj %}
            <tr>
                <td><input type="hidden" name="mid[]" value="{{item.cateid}}"><input type="text" class="ui-form-ip"
                        name="ordnum[]" id="ordnum_{{item.cateid}}" value="{{item.catenum}}" data-rule="required;int;">
                </td>
                <td>{{item.cateid}}</td>
                <td class="ui-text-left"><a href="{cateurl($rs[cateid])}" target="_blank">{{item.catename}}</a></td>
                <td>{% if item.catetype == -1 %}
                    单页
                    {% elif item.catetype == -2 %}
                    链接
                    {% elif item.catetype == 1 %}
                    文章
                    {% elif item.catetype == 2 %}
                    产品
                    {% elif item.catetype == 3 %}
                    招聘
                    {% endif %}
                </td>
                <td><label class="ui-switch ui-switch-info"><input type="checkbox" 
                    {% if item.isshow == 1 %} checked{% endif %} data-url="/manager/category/switchs/?type=1&id={{item.cateid}}"><span
                            class="ui-switch-checkbox ui-switch-text"></span></label></td>
                <td><label class="ui-switch ui-switch-info"><input type="checkbox" 
                    {% if item.isblank == 1 %} checked{% endif %} data-url="/manager/category/switchs/?type=2&id={{item.cateid}}"><span
                            class="ui-switch-checkbox ui-switch-text"></span></label></td>
                <td><label class="ui-switch ui-switch-info"><input type="checkbox" 
                    {% if item.isfilter == 1 %} checked{% endif %} data-url="/manager/category/switchs/?type=3&id={{item.cateid}}"><span
                            class="ui-switch-checkbox ui-switch-text"></span></label></td>
                <td><a href="?fid={{ item.cateid }}"><span class="ui-icon-apartment"></span>
                        子分类（{{ item.snum }}）</a>　<a href="/manager/category/edit?id={{ item.cateid }}&fid={{ item.followid }}"><span
                            class="ui-icon-edit"></span> 编辑</a>　<a href="javascript:;" data-url="/manager/category/move/?id={{ item.cateid }}" class="move"><span class="ui-icon-block"></span> 移动</a>　<a
                        href="javascript:;" class="del" data-url="/manager/category/del/?id={{ item.cateid }}"><span
                            class="ui-icon-delete"></span> 删除</a></td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
{%if page_obj %}
<div class="ui-page ui-page-right ui-page-info">
    <div class="ui-page-other"><button type="submit" class="ui-btn ui-btn-yellow">保存排序</button></div>
    <div class="ui-page-list">
        <ul>
            {% if page_obj.has_previous %}
                <li><a href="?fid={{ fid }}&page=1">首页</a></li>
                <li><a href="?fid={{ fid }}&page={{ page_obj.previous_page_number }}">上一页</a></li>
            {% endif %}

            <li><a>{{ page_obj.number }}/{{ page_obj.paginator.num_pages }}</a></li>
        {% if page_obj.has_next %}
            <li><a href="?fid={{ fid }}&page={{ page_obj.next_page_number }}">下一页</a></li>
            <li><a href="?fid={{ fid }}&page={{ page_obj.paginator.num_pages }}">末页</a></li>
        {% endif %}
        </ul>
    </div>
</div>
{% endif %}